import 'package:eh_mobile/common/routers/index.dart';
import 'package:eh_mobile/common/utils/toast/bnw_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../common/store/user_store.dart';
import '../../main/qrcode_scanner/view.dart';
import 'index.dart';

class LoginPage extends StatefulWidget {
  const LoginPage({Key? key}) : super(key: key);

  @override
  State<LoginPage> createState() => _LoginPageState();
}

class _LoginPageState extends State<LoginPage> {
  @override
  Widget build(BuildContext context) {
    return LoginUtils.loginBgView(
      child: Column(
        children: [
          SizedBox(
            height: ScreenUtil().statusBarHeight + 44.h + 161.h + 273.h,
          ),
          LoginUtils.cornerTextView('绑定账号', () {
            if (UserStore().mobileToken == null) {
              BnwToast.showView(context, infoStr: '正在请求设备信息，请稍后点击');
              return;
            }
            Get.to(const QrcodeScannerPage(),
                routeName: RouteNames.mainQrcodeScanner);
          }),
        ],
      ),
    );
  }

  @override
  void initState() {
    super.initState();
  }
}
